# -*- coding:utf-8 -*-

import heapq

list_my = [0, 1, 2, 3, 4, 5, 6, 7]
# 获取列表中排名前三的最大值
res = heapq.nlargest(3, list_my)
print(res)
# 获取列表中排名后三的最小值
res = heapq.nsmallest(3, list_my)
print(res)
